<?php
/*
 * @Author: your name
 * @Date: 2020-10-16 16:19:55
 * @LastEditTime: 2020-12-17 10:52:20
 * @LastEditors: Please set LastEditors
 * @Description: 防火墙原始规则验证器
 * @FilePath: /special/application/adminapiv3/validate/FirewallOriginRuleValidate.php
 */
namespace app\adminapiv3\validate;

use think\Validate;

class FirewallOriginRuleValidate extends Validate
{
    protected $rule = [
        //主机id
        'host_id|主机id' => 'require|number|length:1,10',
        //规则内容
        'content|规则内容' => 'length:1,255',
        //规则id
        'id|规则id' => 'require|regex:^\d+(,\d+){0,29}$',
    ];

    protected $scene = [
        //列表筛选
        'listFilter' => ['host_id','content'],
        //删除
        'delete' => ['host_id','id'],
        //启用规则
        'onOff' => ['host_id', 'id'],
    ];
}